package com.zg.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zg.dao.GoodsMapper;
import com.zg.pojo.Goods;
import com.zg.service.GoodsService;

@Service("goodsService")
public class GoodsServiceImpl implements GoodsService {

	@Resource
	private GoodsMapper goodsDao;
	
	@Override
	public Goods getGoodsById(int id) {
		return this.goodsDao.selectByPrimaryKey(id);
	}

	@Override
	public int insert(Goods record) {
		return this.goodsDao.insert(record);
	}

	@Override
	public int updateByPrimaryKeySelective(Goods record) {
		return this.goodsDao.updateByPrimaryKeySelective(record);
	}

	@Override
	public int deleteByPrimaryKey(int id) {
		return this.goodsDao.deleteByPrimaryKey(id);
	}

	@Override
	public List<Goods> getGoodsAll() {
		return this.goodsDao.selectAll();
	}
	
}
